package edu.sctu.practice.class01.liangyuxiang.assign03.test1;

/**
 * Created by 梁玉翔 on 2015/10/22.
 */
public class Rectangle extends GeometricObject {

    double area;
    double perimeter;
    double width;
    double length;

    public Rectangle(String color, double width, double longth) {
        super(color);
        this.width = width;
        this.length = longth;
    }

    @Override
    public double findArea() {
        area = length*width;
        return area;
    }

    @Override
    public double findPerimeter() {
        perimeter = 2*width+2*length;
        return perimeter;
    }
}
